<div class="data-div" xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="widget-header bordered-bottom bordered-themeprimary">
        <i class="widget-icon fa fa-tasks themeprimary"></i>
        <span class="widget-caption themeprimary">数据列表</span>
        <form  role="form" onsubmit="return false;" id="form_data_table_vip_order_list_1">
            <div class="widget-buttons">
                购买类型:<select name="type" id="type"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="0">--线上--</option>
                            <option value="10">--线下--</option>
                        </select>
                支付状态:<select name="orderStatus"  style="width:160px;margin-right:10px;padding: 3px;" >
                            <option value="">--全部--</option>
                            <option value="0">--未支付--</option>
                            <option value="1">--已支付--</option>
                        </select>
                订单ID：<input type="text" name="orderId" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
                用户：  <input type="text" name="userName" style="width:120px;height:25px;margin-right:10px;padding: 3px;">
            </div>
            <div class="widget-buttons">
                <button href="javascript:;" class="btn btn-blue btn-xs search"  data-title="查询" data-form="true" onclick="">查询</button>
            </div>

        </form>
    </div>

    <div class="widget no-header ">
        <div class="widget-body">
            <table class="table table-condensed table-bordered table-hover " id="data_table_vip_order_list_1">
            </table>

        </div>
    </div>
    <!-- END SAMPLE TABLE PORTLET-->
</div>


<script type="text/javascript">

    $(document).ready(function() {

        //look-up 查询条件 会员
        Select2Ex.handleForm4select2({target:$("#form_data_table_vip_order_list_1")});

        TableAjax.init('data_table_vip_order_list_1',{
            sAjaxSource: "vip/order/list",
            aaSorting: [
                [0, "asc" ]
            ], // 需要自定义
            uxDataTitle:"null",
            uxCheckable:false,
            uxCloseScroll:true,
            uxDrapable:false,
            aoColumns: [
                {sTitle:'订单ID',  mData: "id",uxLongText:true},
                {sTitle:'用户',  mData: "buyUser.userName"},
                {sTitle:'用户昵称',  mData: "buyUser.nickName"},
                {sTitle:'购买或升级的用户类型',  mData: "vipType",
                    mRender:function(data,d,all){
                        var vip = "";
                        if(all.vipType==1){vip="运营商";}
                        if(all.vipType==2){vip="渠道商";}
                        if(all.vipType==3){vip="推广员";}
                        if(all.vipType==0){vip="粉丝";}
                        if(all.vipType==21){vip="省级服务商";}
                        if(all.vipType==23){vip="区县服务商";}
                        return vip;
                    }
                },
                {sTitle:'付款状态',  mData: "orderStatus",
                    mRender:function(data,d,all){
                        if (all.orderStatus==0){
                            return "<font color='red'>未支付</font>";
                        }else if (all.orderStatus==1){
                            return "<font color='green'>已支付</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'金额（元）',  mData: "totAmount",
                    mRender:function (all,d,all) {
                        return (all.totAmount/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                    }
                },
                {sTitle:'直推人',  mData: "pushUid",mRender:function (all,d,all) {
                    if(all.pushUid>0){
                        return all.pushUser.userName;
                    }else {
                        return "-";
                    }

                    }},
                {sTitle:'直推人昵称',  mData: "pushUid",mRender:function (all,d,all) {
                        if(all.pushUid>0){
                            return all.pushUser.nickName;
                        }else {
                            return "-";
                        }

                    }},
                {sTitle:'直推人分成比例（%）',  mData: "pushSplit",mRender:function (all,d,all) {
                        if(all.pushUid>0){
                            return all.pushSplit;
                        }else {
                            return "-";
                        }
                }},
                {sTitle:'直推人分成（元）',  mData: "pushAmount",
                    mRender:function (all,d,all) {
                        if(all.pushUid>0){
                            return (all.pushAmount/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                        }else {
                            return "-";
                        }

                    }
                },
                {sTitle:'间推人',  mData: "gradePushUid",mRender:function (all,d,all) {
                        if(all.gradePushUid>0){
                            return all.gradeUser.userName;
                        }else {
                            return "-";
                        }

                 }},
                {sTitle:'间推人昵称',  mData: "gradePushUid",mRender:function (all,d,all) {
                        if(all.gradePushUid>0){
                            return all.gradeUser.nickName;
                        }else {
                            return "-";
                        }

                    }},
                {sTitle:'间推人分成比例（%）',  mData: "gradeSplit",mRender:function (all,d,all) {
                        if(all.gradePushUid>0){
                            return all.gradeSplit;
                        }else {
                            return "-";
                        }
                    }},
                {sTitle:'间推人分成（元）',  mData: "gradeAmount",
                    mRender:function (all,d,all) {
                        if(all.gradePushUid>0){
                            return (all.gradeAmount/100).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
                        }else {
                            return "-";
                        }

                    }
                },
                {sTitle:'购买类型',  mData: "type",
                    mRender:function(data,d,all){
                        if (all.type==0){
                            return "<font color='green'>线上</font>";
                        }else if (all.type==10){
                            return "<font color='red'>线下</font>";
                        }
                        return "未知";
                    }
                },
                {sTitle:'创建时间',  mData: "insertTime",mRender:function(data,d,all){
                        return all.insertTimeStr+'';
                 }}

            ]

        });

    });

</script>